<template>
  <header class="header">
      <h1>todos</h1>
      <input class="new-todo" placeholder="请输入任务名称" autofocus v-model="uname" @keyup.enter="addList"/>
    </header>
</template>

<script>
export default {
  name: 'ToHeader',
  props: {},
  components: {},
  data() {
    return {
        uname:''
    };
  },
  methods: {
    addList() {
        // console.log(1);
        this.$emit('addList',this.uname)
        this.uname=''
    }
  },

};
</script>

<style scoped lang="less"></style>
